package com.itheima.d1_streamdemo;

import java.util.*;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class StreamDemo {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        Collections.addAll(list,"张无忌","张三丰","周芷若","赵敏");
        System.out.println(list);
        // 1. 集合获取流
        Stream<String> stream = list.stream();

        // 2. Map集合获取流
        Map<String,Integer> maps = new HashMap<>();
        // 分开拿流
        Set<String> keySet = maps.keySet();
        Stream<String> keyStream = keySet.stream();
        Collection<Integer> values = maps.values();
        Stream<Integer> valueStream = values.stream();
        // 键值对一起拿
        Set<Map.Entry<String, Integer>> entrySet = maps.entrySet();
        Stream<Map.Entry<String, Integer>> entryStream = entrySet.stream();

        // 3 数组怎么拿流
        int[] numbers={1,2,44};
        IntStream intStream = Arrays.stream(numbers);
        Stream<int[]> stream1 = Stream.of(numbers);


    }
}
